package com.alvis.media.repository;

import com.alvis.media.domain.VideoInfo;
import com.alvis.media.viewmodel.video.VideoPageRequestVM;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface VideoInfoMapper extends MediaBaseMapper<VideoInfo> {
    int deleteByPrimaryKey(Integer videoId);

    int insert(VideoInfo record);

    int insertSelective(VideoInfo record);

    VideoInfo selectByPrimaryKey(Integer videoId);

    int updateByPrimaryKeySelective(VideoInfo record);

    int updateByPrimaryKey(VideoInfo record);

    /**
     * 视频列表分页查询
     */
    List<VideoInfo> selectVideoPage(VideoPageRequestVM requestVM);

    /**
     * 根据videoUrl获取videoId
     */
    Integer selectVideoIdBydUrl(String videoUrl);

    /**
     * 选则热点视频列表（取前3个最热视频）
     */
    List<VideoInfo> selectHotVideoList();

    /**
     * 查询本月新增视频个数
     */
    int selectNewVideoCount(VideoInfo videoInfo);

    List<VideoInfo> findVideoPage(VideoPageRequestVM requestVM);

    VideoInfo selectByVideoName(String name);
}